/*! \file fdblackscholesmertonhwvanillaengine.hpp
    \brief Finite-Differences Black Scholes for vanilla employee stock options
*/

#ifndef quantlib_fd_black_scholes_merton_hw_vanilla_engine_hpp
#define quantlib_fd_black_scholes_merton_hw_vanilla_engine_hpp

#include <ql/pricingengine.hpp>
#include "vanillaempoption.h"
#include <ql/experimental/finitedifferences/fdmbackwardsolver.hpp>

namespace QuantLib {

    //! Finite-Differences Black Scholes for vanilla employee stock options

    /*! \ingroup vanillaengines

        \test the correctness of the returned value is tested by
              reproducing results available in web/literature
              and comparison with Black pricing.
    */
    class BlackScholesMertonHWProcess;

    class FdBlackScholesMertonHWVanillaEngine
        : public GenericEngine<VanillaEmpOption::arguments,
                               VanillaEmpOption::results> {
      public:
        // Constructor
          FdBlackScholesMertonHWVanillaEngine(
                const boost::shared_ptr<BlackScholesMertonHWProcess>&,
                Size tGrid = 100, 
				Size xGrid = 100, 
				Size dampingSteps = 0,
                const FdmSchemeDesc& schemeDesc = FdmSchemeDesc::Douglas(),
                bool localVol = false,
                Real illegalLocalVolOverwrite = -Null<Real>());

        void calculate() const;

      private:
        const boost::shared_ptr<BlackScholesMertonHWProcess> process_;
        const Size tGrid_, xGrid_, dampingSteps_;
        const FdmSchemeDesc schemeDesc_;
        const bool localVol_;
        const Real illegalLocalVolOverwrite_;
    };
}

#endif